#include <iostream>

int const maxn = 20;
long long fact[maxn];

int main()
{
	int n; std::cin >> n;
	fact[0] = 1;
	long long ans = 0;
	for (int i = 1; i <= n; i++) {
		fact[i] = fact[i - 1] * i;
		ans += fact[i];
	}
	std::cout << ans << '\n';
}

